/*
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 1, or (at your option)
** any later version.

** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.

** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/

/*
Date: 18.09.2002
*/

/*
* Author : Boris Mikhailenko <stg@pochtamt.ru>
*/
//---------------------------------------------------------------------------

#ifndef CommonH
#define CommonH

#define ST_F    0
#define ST_B    1
#define ST_KB   2
#define ST_MB   3

//#define FORM_WIDTH_1  396
//#define FORM_WIDTH_2  496

#define MSG_RECV_ALL            0
#define MSG_RECV_IMPORTANT      1
#define MSG_RECV_NONE           2

#define DIR_NAME_LEN 16

typedef char string16[DIR_NAME_LEN];

#ifndef WIN32
typedef long long __int64;
#endif

#include <QString>
#include "packet.h"

//---------------------------------------------------------------------------
struct IA_VERSION
{
unsigned short major;  // v1
unsigned short minor;  // v2
unsigned short proto;  // v3
unsigned short unused; // v4
};
//---------------------------------------------------------------------------
struct PAIR
{
	int a;
	int b;
};
//---------------------------------------------------------------------------
struct SETTINGS
{
QString    serverIP;
int     serverPort;
QStringList * dirName;
int     autoconn;
int     neverSavePass;
int     savePass;
int     statType;
int     updownload;
int     reconnect;
int     outHintCash;
int     outHintTraffic;
int     outHintTrafficDir;
int     bindPassHDD;
int     gridRowCount;
int     ipEditable;
int     portEditable;
int     showSumm;
double  lowCash;
int     lowCashWarning;
QString  currency;
int     minimizeOnClose;
QString messagesfile;
};
//---------------------------------------------------------------------------
void KOIToWin(char * s2, const char * s1, int l);
void WinToKOI(char * s2, const char * s1, int l);
void EncodeStr(char * str, unsigned long serial, int useHDD);
void DecodeStr(char * str, unsigned long serial, int useHDD);
char *IntToKMG(__int64 a, int);
int Min8(int a);
int strtod(const char *s, double &ddd);
//---------------------------------------------------------------------------
#endif
